<?php
/**
 * 配置注册类
 * @author sunhaoqiang(shqdev@163.com)
 * @time: 2019-08-25 16:38
*/
namespace script;

use script\Conf;
class Config
{
    protected static $config = [];
    public static function set($key, Conf $obj)
    {
        self::$config[$key] = $obj;
    }

    public static function get($key)
    {
        return self::$config[$key] ?? [];
    }

    public static function array()
    {
        return self::$config;
    }

    public static function exists($key)
    {
        return key_exists($key, self::$config);
    }

    public static function del($key)
    {
        unset(self::$config[$key]);
    }

}